const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const router = new Router();
// 换算购物车
router.post('/app/delCartByBuId', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId
    let buId = ctx.request.body.buId
    await db.models['cart'].destroy({
        where: {
            tenantId,
            buId,
            uid: usr.id
        }
    })

    return ctx.suc('')
})
router.post('/app/delCartById', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId
    let id = ctx.request.body.id
    await db.models['cart'].destroy({
        where: {
            tenantId,
            id
        }
    })

    return ctx.suc('')
})

module.exports = router;
